home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / sun3.md / userSysCallInt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-19  |  1.3 KB  |  41 lines

  1. |*
  2. |* userSysCallInt.h --
  3. |*
  4. |*     Contains macro for stubs for user-level system calls.
  5. |*
  6. |* Copyright 1985, 1988 Regents of the University of California
  7. |* Permission to use, copy, modify, and distribute this
  8. |* software and its documentation for any purpose and without
  9. |* fee is hereby granted, provided that the above copyright
  10. |* notice appear in all copies.  The University of California
  11. |* makes no representations about the suitability of this
  12. |* software for any purpose.  It is provided "as is" without
  13. |* express or implied warranty.
  14. |*
  15. |* rcs = $Header: userSysCallInt.h,v 1.1 88/06/19 14:30:08 ouster Exp $ SPRITE (Berkeley)
  16. |*
  17.  
  18. #include "kernel/sysSysCall.h"
  19. #ifndef _USERSYSCALLINT
  20. #define _USERSYSCALLINT
  21. /*
  22.  * ----------------------------------------------------------------------------
  23.  *
  24.  * SYS_CALL --
  25.  *
  26.  *      Define a user-level system call.  The call sets up a trap into a 
  27.  *    system-level routine with the appropriate constant passed as
  28.  *     an argument to specify the type of system call.
  29.  * ----------------------------------------------------------------------------
  30.  */
  31.  
  32. #define SYS_CALL(name, constant) \
  33.     .globl _/**/name; _/**/name: \
  34.     movl #constant, sp@- ; \
  35.     movl #constant, d0; \
  36.     trap #1; \
  37.     addql #4, sp ; \
  38.     1: rts;
  39.  
  40. #endif _USERSYSCALLINT
  41.